<%@ page contentType="text/html; charset=utf-8" language="java"
	errorPage=""%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>无标题文档</title>
		<style type="text/css">
<!--
body {
	margin-left: 3px;
	margin-top: 0px;
	margin-right: 3px;
	margin-bottom: 0px;
}
.STYLE1 {
	color: #e1e2e3;
	font-size: 12px;
}
.STYLE6 {color: #000000; font-size: 12; }
.STYLE10 {color: #000000; font-size: 12px; }
.STYLE19 {
	color: #344b50;
	font-size: 12px;
}
.STYLE21 {
	font-size: 12px;
	color: #3b6375;
}
.STYLE22 {
	font-size: 12px;
	color: #295568;
}
-->
</style>
		<script>
var  highlightcolor='#d5f4fe';
//此处clickcolor只能用win系统颜色代码才能成功,如果用#xxxxxx的代码就不行,还没搞清楚为什么:(
var  clickcolor='#51b2f6';
function  changeto(){
source=event.srcElement;
if  (source.tagName=="TR"||source.tagName=="TABLE")
return;
while(source.tagName!="TD")
source=source.parentElement;
source=source.parentElement;
cs  =  source.children;
//alert(cs.length);
if  (cs[1].style.backgroundColor!=highlightcolor&&source.id!="nc"&&cs[1].style.backgroundColor!=clickcolor)
for(i=0;i<cs.length;i++){
	cs[i].style.backgroundColor=highlightcolor;
}
}

function  changeback(){
if  (event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="nc")
return
if  (event.toElement!=source&&cs[1].style.backgroundColor!=clickcolor)
//source.style.backgroundColor=originalcolor
for(i=0;i<cs.length;i++){
	cs[i].style.backgroundColor="";
}
}

function doAllDel()
{    		
			
			var tag=false;
			form = document.getElementById("batchForm");						
			for(var i=0; i<form.elements.length; i++)
			{ 			    
				if (form.elements[i].type=="checkbox")
				{
					if(form.elements[i].checked==true )
					{					  
					   tag=true;			  
					}					
				}
			}
			if(tag==false)
			{
				alert("请选择要删除的用户！");
				return false;
			}
			else{			
			var s=window.confirm("您是否确定删除？");
				if(s!=0)	
				{
					form.action="/userBase.do?action=del";
					form.submit();
				}
			}
}

function doUpdate()
{    		
			
			var tag=false;
			form = document.getElementById("batchForm");						
			for(var i=0; i<form.elements.length; i++)
			{ 			    
				if (form.elements[i].type=="checkbox")
				{
					if(form.elements[i].checked==true )
					{					  
					   tag=true;
					}					
				}
			}
			if(tag==false)
			{
				alert("请选择要修改的用户！");
				return false;
			}
			else{				
				form.action="/listUser.do?action=getUser";
				form.submit();			
			}
}

function  clickto(){
source=event.srcElement;
if  (source.tagName=="TR"||source.tagName=="TABLE")
return;
while(source.tagName!="TD")
source=source.parentElement;
source=source.parentElement;
cs  =  source.children;
//alert(cs.length);
if  (cs[1].style.backgroundColor!=clickcolor&&source.id!="nc")
for(i=0;i<cs.length;i++){
	cs[i].style.backgroundColor=clickcolor;
}
else
for(i=0;i<cs.length;i++){
	cs[i].style.backgroundColor="";
}
}

function toPage()
{
  if(isNaN(document.all.page.value)){
    alert("跳转页面只能为数字！");
    return false;
  }
  document.all.batchForm.action="/listUser.do?action=find";
  document.all.batchForm.submit();

}
</script>


	</head>

	<body>
		<form id="batchForm" name="batchForm" action="" method="post">
			<table width="100%" border="0" align="center" cellpadding="0"
				cellspacing="0">
				<tr>
					<td height="30">
						<table width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td height="24" bgcolor="#353c44">
									<table width="100%" border="0" cellspacing="0" cellpadding="0">
										<tr>
											<td>
												<table width="100%" border="0" cellspacing="0"
													cellpadding="0">
													<tr>
														<td width="6%" height="19" valign="bottom">
															<div align="center">
																<img src="images/tb.gif" width="14" height="14" />
															</div>
														</td>
														<td width="94%" valign="bottom">
															<span class="STYLE1"> 管理人员基本信息列表</span>
														</td>
													</tr>
												</table>
											</td>
											<td>
												<div align="right">
													<span class="STYLE1"> <input type="checkbox"
															name="checkbox11"
															onclick="for(i=0;i<=document.all.batchid.length-1;i++){document.all.batchid(i).checked=document.getElementById('checkbox11').checked}"
															id="checkbox11" /> 全选 &nbsp;&nbsp;<img
															src="images/add.gif" width="10" height="10" /><a
														style="cursor: pointer;"
														onClick="javascript:location='listUser.do?action=getSchool';">
															添加 </a> &nbsp; <img src="images/del.gif" width="10"
															height="10" /><a style="cursor: pointer;"
														onClick="doAllDel()"> 删除 </a> <input type="hidden"
															name="delAll" id="delAll" value="" /> &nbsp;&nbsp;<img
															src="images/edit.gif" width="10" height="10" /><a
														style="cursor: pointer;" onClick="doUpdate()"> 编辑</a>
														&nbsp;</span><span class="STYLE1"> &nbsp;</span>
												</div>
											</td>
										</tr>
									</table>
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td>
						<table width="100%" border="0" cellpadding="0" cellspacing="1"
							bgcolor="#a8c7ce" onmouseover="changeto()"
							onmouseout="changeback()">
							<tr>
								<td width="4%" height="20" bgcolor="d3eaef" class="STYLE10">
									<div align="center">
										<input type="checkbox"
											onclick="for(i=0;i<=document.all.batchid.length-1;i++){document.all.batchid(i).checked=document.getElementById('checkbox').checked}"
											name="checkbox" id="checkbox" />
									</div>
								</td>
								<td width="10%" height="20" bgcolor="d3eaef" class="STYLE6">
									<div align="center">
										<span class="STYLE10">用户名登录名</span>
									</div>
								</td>
								<td width="27%" height="20" bgcolor="d3eaef" class="STYLE6">
									<div align="center">
										<span class="STYLE10">用户真实姓名</span>
									</div>
								</td>
								<td width="15%" height="20" bgcolor="d3eaef" class="STYLE6">
									<div align="center">
										<span class="STYLE10">用户角色</span>
									</div>
								</td>
								<td width="14%" height="20" bgcolor="d3eaef" class="STYLE6">
									<div align="center">
										<span class="STYLE10">用户所属行政区</span>
									</div>
								</td>
								<td width="16%" height="20" bgcolor="d3eaef" class="STYLE6">
									<div align="center">
										<span class="STYLE10">用户所属学校</span>
									</div>
								</td>
								<td width="14%" height="20" bgcolor="d3eaef" class="STYLE6">
									<div align="center">
										<span class="STYLE10">基本操作</span>
									</div>
								</td>
							</tr>
							<logic:iterate id="user" name="list"
								type="cn.hnedu.dms.entity.UserBase">
								<tr>
									<td height="20" bgcolor="#FFFFFF">
										<div align="center">
											<input type="checkbox" name="batchid" id="batchid"
												value="${user.id }" />
										</div>
									</td>
									<td height="20" bgcolor="#FFFFFF" class="STYLE6">
										<div align="center">
											<span class="STYLE19"><bean:write name="user"
													property="entername" /> </span>
										</div>
									</td>
									<td height="20" bgcolor="#FFFFFF" class="STYLE19">
										<div align="center">
											<bean:write name="user" property="username" />
										</div>
									</td>
									<td height="20" bgcolor="#FFFFFF" class="STYLE19">
										<div align="center">
											<bean:write name="user" property="role" />
										</div>
									</td>
									<td height="20" bgcolor="#FFFFFF" class="STYLE19">
										<div align="center">
											<bean:write name="user" property="department" />
										</div>
									</td>
									<td height="20" bgcolor="#FFFFFF" class="STYLE19">
										<div align="center">
											<bean:write name="user" property="xxdm" />
										</div>
									</td>
									<td height="20" bgcolor="#FFFFFF">
										<div align="center" class="STYLE21">
											<a style="cursor: pointer;"
												onclick="javascript:var i=window.confirm('是否确定删除？');if(i!=0)location='/userBase.do?action=del&batchid=${user.id }';else return null;">删除
											</a>|
											<a
												href="/listUser.do?action=show&id=${user.id }&xxdm=${user.xxdm }">
												查看</a>
										</div>
									</td>
								</tr>
							</logic:iterate>
						</table>
					</td>
				</tr>
				<tr>
					<td height="30">
						<table width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td width="33%">
									<div align="left">
										<span class="STYLE22">&nbsp;&nbsp;&nbsp;&nbsp;共有<strong><bean:write
													name="p" property="totalCount" /> </strong> 条记录，当前第<strong>
												<bean:write name="p" property="currPage" /> </strong> 页，共 <strong><bean:write	name="p" property="totalPage" /> </strong> 页</span>
									</div>
								</td>
								<td width="67%">
									<table width="312" border="0" align="right" cellpadding="0"
										cellspacing="0">
										<tr>
											<td width="49">
												<div align="center">
													<a href="/listUser.do?action=find" ><img src="/images/main_54.gif" width="40" height="15" border="0" /></a>
												</div>
											</td>
											<td width="49">
												<div align="center">
													<logic:equal value="true" name="p" property="hasPreviousPage"><a href="/listUser.do?action=find&page=${p.previousPage}"><img src="/images/main_56.gif" width="45" height="15" border="0" /></a></logic:equal>
												<logic:notEqual value="true" name="p" property="hasPreviousPage"><img src="/images/main_56.gif" width="45" height="15" border="0"/></logic:notEqual>
												</div>
											</td>
											<td width="49">
												<div align="center">
													<logic:equal value="true" name="p" property="hasNextPage"><a href="/listUser.do?action=find&page=${p.nextPage}"><img src="/images/main_58.gif" width="45" height="15" border="0" /></a></logic:equal><logic:notEqual value="true" name="p" property="hasNextPage"><img src="/images/main_58.gif" width="45" height="15" border="0" /></logic:notEqual>
												</div>
											</td>
											<td width="49">
												<div align="center">
													<a href="/listUser.do?action=find&page=${p.totalPage}"><img src="/images/main_60.gif" width="40" height="15" border="0" /></a>
												</div>
											</td>
											<td width="37" class="STYLE22">
												<div align="center">
													转到
												</div>
											</td>
											<td width="22" valign="middle">
												<div align="center">
													<input type="text" name="page" id="page" value='${p.currPage}'  style="width:20px; height:12px; font-size:12px; border:solid 1px #7aaebd;"  />
												</div>
											</td>
											<td width="22" class="STYLE22">
												<div align="center">
													页
												</div>
											</td>
											<td width="35">
												<img src="/images/main_62.gif" width="26" style="cursor:pointer" onclick="toPage()" height="15" />
											</td>
										</tr>
									</table>
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</form>
	</body>
</html>
